import request from '@/utils/request.js';

// 账号注册
export function register(data){
	return request.post('/equipment/member/register', data, true)
}

// 忘记密码
export function forgetPassword(data){
	return request.post('/equipment/member/forgetPassword', data, true)
}

// 账号密码登录
export function passwordLogin(data){
	return request.post('/equipment/member/passwordLogin', data, true)
}

// 验证码登录
export function codeLogin(data){
	return request.post('/equipment/member/codeLogin', data, true)
}

// 微信登录
export function wxLogin(data){
	return request.post('/equipment/member/wxLogin', data, true)
}

// 查询微信授权信息
export function getWxInfo(data){
	return request.post('/equipment/member/getOpenid', data, true)
}

// 查询用户信息
export function getUserInfo(data){
	return request.get('/equipment/member/memberInfo', data)
}

// 修改头像
export function updateAvatar(data){
	return request.post('/equipment/member/updateAvatar', data)
}

// 修改密码
export function updatePassword(data){
	return request.post('/equipment/member/updatePassword', data)
}

// 实名认证
export function applyRealName(data){
	return request.post('/equipment/real/applyReal', data)
}

// 成为企业账号
export function becomeFirm(data){
	return request.post('/equipment/member/becomeFirm', data, true)
}

// 查询店铺信息
export function getFirmInfo(data){
	return request.get('/equipment/firm/firmInfo', data, true)
}

// 编辑店铺信息
export function editFirm(data){
	return request.post('/equipment/firm/editFirm', data, true)
}

// 收藏商品或企业
export function collect(data){
	return request.post('/equipment/collect/collect', data, true)
}

// 查询收藏列表
export function getCollectList(data){
	return request.get('/equipment/collect/list', data, true)
}

// 新增或编辑地址
export function saveOrUpdateAddress(data){
	return request.post('/equipment/address/saveOrUpdate', data, true)
}

// 获取默认收货地址
export function getDefaultAddress(data){
	return request.post('/equipment/address/getDefaultAddress', data, false)
}
